package com.jk.vehicle.core.entity;

import com.jk.vehicle.core.utils.TimeUtil;
import lombok.Data;

import java.io.Serializable;

/**
 * 推送结构体
 * @author wuzhipeng
 * @date 2018-12-03
 */
@Data
public class BasePushEntity<T> implements Serializable {
    /**
     * 时间格式
     */
    private static String timeFormat = "yyyy-MM-dd HH:mm:ss";

    public BasePushEntity() {
        this.time = TimeUtil.getCurrentTime(timeFormat);
    }

    public BasePushEntity(int type, T data) {
        this.time = TimeUtil.getCurrentTime(timeFormat);
        this.type = type;
        this.data = data;
    }

    /**
     * 推送时间
     */
    private String time;

    /**
     * 推送类型
     */
    private int type;

    /**
     * 数据体
     */
    private T data;

}
